﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

public class Missile: Weapon
{
    public float m_TrunVelocity = 160;
    public float m_Hp = 10;
    public GameObject m_Target;
    public float m_Acceleration = 1;

    public override FlyItem Fire(GameObject ship, WeaponSlot slot, Vector3 position, Vector3 direction)
    {
        if (ship)
            m_Ship = ship.GetComponent<Ship>();
        var item = base.Fire(ship, slot, position, direction);
        MissileFunction missile = item as MissileFunction;
        if(missile)
        {
            missile.m_HP = m_Hp;
            missile.m_Target = m_Target;
        }
        return item;
    }
}